package com.yangyang.androidconnect.phoneinfo.controller;

import com.yangyang.androidconnect.common.ApiResult;
import com.yangyang.androidconnect.phoneinfo.service.CallLogService;
import com.yanzhenjie.andserver.annotation.GetMapping;
import com.yanzhenjie.andserver.annotation.RequestMapping;
import com.yanzhenjie.andserver.annotation.RequestParam;
import com.yanzhenjie.andserver.annotation.RestController;

@RestController
@RequestMapping(path = "/api/callrecord")
public class CallRecordController {

    @GetMapping(path = "/page-list")
    public ApiResult pageList(
            @RequestParam(value = "search", required = false, defaultValue = "") String search,
            @RequestParam(value = "page", required = false, defaultValue = "1") Integer page,
            @RequestParam(value = "pageSize", required = false, defaultValue = "200") Integer pageSize
    ) throws Exception {

        CallLogService callLogService = new CallLogService();

        return ApiResult.ok(callLogService.getAllCallLog());
    }
}
